package com.xcw;

import org.springframework.context.annotation.Configuration;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

/**
 * @Author bhx
 * @Date 2022/11/8 1:41
 * @Description TODO
 */
@Configuration
public class ServletListener implements ServletContextListener {

        @Override

        public void contextInitialized(ServletContextEvent sce) {

            System.out.println("事件开始！" + sce.getServletContext().getServletContextName());

        }

        @Override

        public void contextDestroyed(ServletContextEvent sce) {

            System.out.println("事件结束！" + sce.getServletContext().getServletContextName());

        }


}
